home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / DJSRC111.ZIP / go32 / doutils.asm < prev    next >
Assembly Source File  |  1993-10-02  |  2KB  |  95 lines

  1. ; This is file DOUTILS.ASM
  2. ;
  3. ; Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  4. ;
  5. ; This file is distributed under the terms listed in the document
  6. ; "copying.dj", available from DJ Delorie at the address above.
  7. ; A copy of "copying.dj" should accompany this file; if not, a copy
  8. ; should be available from where this file was obtained.  This file
  9. ; may not be distributed without a verbatim copy of "copying.dj".
  10. ;
  11. ; This file is distributed WITHOUT ANY WARRANTY; without even the implied
  12. ; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. ;
  14.  
  15.     title    do_utils
  16.     .386p
  17.  
  18.     include    segdefs.inc
  19.     include tss.inc
  20.     include gdt.inc
  21.     include idt.inc
  22.  
  23. ;------------------------------------------------------------------------
  24.  
  25.     start_data16
  26.  
  27.     end_data16
  28.  
  29. ;------------------------------------------------------------------------
  30.  
  31.     start_code16
  32.  
  33.     extrn    _fclex:near
  34.  
  35.     public    __do_memset32
  36. __do_memset32:
  37.     push    cx
  38.     shr    cx,2
  39.     jcxz    nodset
  40.     db    67h        ; so EDI is used
  41.     rep    stosd
  42. nodset:
  43.     pop    cx
  44.     and    cx,3
  45.     jcxz    nobset
  46.     db    67h        ; so EDI is used
  47.     rep    stosb
  48. nobset:
  49.     jmpt    g_ctss
  50.  
  51. ;------------------------------------------------------------------------
  52.  
  53.     public    __do_memscan32
  54. __do_memscan32:
  55.     db    67h        ; so ESI is used
  56.     lodsb
  57.     db    67h        ; so EDI is used
  58.     stosb
  59.     cmp    al,bl
  60.     jne    __do_memscan32
  61.     jmpt    g_ctss
  62.  
  63. ;------------------------------------------------------------------------
  64.  
  65.     public    __do_memmov32
  66. __do_memmov32:
  67.     push    cx
  68.     shr    cx,2
  69.     jcxz    nodmove
  70.     db    67h        ; so ESI,EDI is used
  71.     rep    movsd
  72. nodmove:
  73.     pop    cx
  74.     and    cx,3
  75.     jcxz    nobmove
  76.     db    67h        ; so ESI,EDI is used
  77.     rep    movsb
  78. nobmove:
  79.     jmpt    g_ctss
  80.  
  81.  
  82. ;------------------------------------------------------------------------
  83.  
  84.     end_code16
  85.  
  86. ;------------------------------------------------------------------------
  87.  
  88.     start_code32
  89.  
  90.     end_code32
  91.  
  92. ;------------------------------------------------------------------------
  93.  
  94.     end
  95.